<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="../links.jsp"></jsp:include>
<script type="text/javascript">
	$(function() { 
		var admin_userUpdate_form;
		admin_userUpdate_form = $('#admin_userUpdate_form').form({
			url : getRootPath() + '/userAction/update.do',
			success : function(r) {
				r = $.parseJSON(r);//将标准json转成obj
				if (r && r.success) {
					$.messager.show({
						title : '提示',
						msg : '修改成功',
						showType : 'show'
					});
				} else {
					$.messager.alert('提示', '更新失败');

				}
			}
		});
		admin_user_update_fun = function() {
			if ($('#uid1').val() == null || $('#uid1').val() == "") {
				$.messager.alert('提示', '请输入用户名编号');
				return false;
			}
			if ($('#name1').val() == null || $('#name1').val() == "") {
				$.messager.alert('提示', '请输入用户名');
				return false;
			}
			if ($('#pwd1').val() != $('#pwd2').val()) {
				$.messager.alert('提示', '两次密码输入不一致');
				$("input[name='pwd']").val('');
				$("input[name='repwd']").val('');
				return false
			}
			if (($('#pwd1').val() == "" || $('#pwd1').val() == null)) {
				$.messager.alert('提示', '密码不能为空');
				return false;
			} else {
				$('#admin_userUpdate_form').submit();
			}
			return true;
		}

	})
</script>
<div id="admin_userUpdate" style="position: absolute; left: 32%; top: 20%;">
	<form id="admin_userUpdate_form" method="post">
		<table cellpadding="5">
			<tr>
				<th>编号(*)</th>
				<td><input id="uid1" class="easyui-validatebox" type="text" name="uid"
					data-options="novalidate:true,missingMessage:'请输入用户名'"></input></td>
			</tr>
			<tr>
				<th>用户名</th>
				<td><input id="name1" class="easyui-validatebox" type="text" name="name"
					data-options="novalidate:true,missingMessage:'请输入用户名'"></input></td>
			</tr>
			<tr>
				<th>密码</th>
				<td><input id="pwd1" class="easyui-validatebox" name="pwd" type="password"
					data-options="novalidate:true,missingMessage:'请输入密码'" /></td>
			</tr>
			<tr>
				<th>确认密码</th>
				<td><input id="pwd2" class="easyui-validatebox" name="repwd" type="password"
					data-options="novalidate:true,missingMessage:'重复输入密码'" /></td>
			</tr>
			<tr>
				<th>用户类型</th>
				<td><select class="easyui-combobox" name="type" style="width: 155%;" panelHeight="42px">
						<option value="admin">管理员</option>
						<option value="user">普通用户</option>
				</select></td>
			</tr>
			<tr>
				<th>创建时间(*)</th>
				<td><input id="input2" name="createdatetime" class="easyui-datebox" editable="false" /></td>
			</tr>
			<tr>
				<td colspan="2"><span><a href="javascript:;" class="easyui-linkbutton" style="width: 288px;"
						onclick="admin_user_update_fun()"><font color="red">修改用户信息</font></a></span></td>
			</tr>
		</table>
	</form>
</div>